Skip to content

docgen: more fixes#3266

Merged
lerno merged 9 commits into
c3lang:masterfrom
ManuLinares:docgen-fixes
May 28, 2026
Merged

docgen: more fixes#3266
lerno merged 9 commits into
c3lang:masterfrom
ManuLinares:docgen-fixes

Conversation

@ManuLinares
Copy link
Copy Markdown
Member

@ManuLinares ManuLinares commented May 26, 2026

  • Add --emit-stdlib=<yes|no> to the docgen: Omits printing the stdlib from the output.

handle TYPE_COMPRESSED_*

example: https://c3-lang.org/standard-library/docs.html#std::thread::channel::create_one_shot

before:

          "return_type": {
            "name": "OneShotChannel?",
            "uid": "std::thread::channel::OneShotChannel"

now:

          "return_type": {
            "name": "OneShotChannel*?",
            "uid": "std::thread::channel::OneShotChannel"
          },

before was showing this signature in the web:
fn OneShotChannel? create_one_shot(Allocator allocator) <Type>
now correctly shows
fn OneShotChannel*? create_one_shot(Allocator allocator) <Type>


handle varargs ...

added "is_vararg": true to the json

example:
https://c3-lang.org/standard-library/docs.html#std::encoding::pem::encode_many
before it was showing this signature in the web:
fn String? encode_many(Allocator allocator, char[][] bodies, String[] tags, PemHeader[][] pem_headers, bool use_crlf = false)
now correctly shows
fn String? encode_many(Allocator allocator, char[][] bodies, String[] tags, PemHeader[]... pem_headers, bool use_crlf = false)


We correctly omit showing empty "contract" column for generic macro like docs.html#std::collections::linkedlist::linked_list_alloc_node, and on methods we are correctly showing the type of &self, as the field type.




TODO: We are missing showing the type for a generic method: for example for docs.html#std::collections::linkedlist::LinkedList.last we should be showing LinkedList{Type}. this could be handled in the frontend

we already have the info in the json:

{
  "name": "last",
  "kind": "method",
  "uid": "std::collections::linkedlist::LinkedList.last",
  "file": "lib/std/collections/linkedlist.c3:131:21",
  "is_generic": true,
  "generic_parameters": [
    "Type"
  ],
  "return_type": {
    "name": "Type?"
  },
  "members": [
    {
      "name": "self",
      "is_ref": true
    }
  ],
  "docs": null
}

@ManuLinares ManuLinares marked this pull request as ready for review May 28, 2026 06:29
@lerno lerno merged commit c240e3f into c3lang:master May 28, 2026
15 of 16 checks passed
@lerno
Copy link
Copy Markdown
Collaborator

lerno commented May 28, 2026

Thank you!

@ManuLinares ManuLinares deleted the docgen-fixes branch May 28, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants